import http from '@/util/request';

export default {
    //微信获取openid
    oauth: (data: any) =>
        http.post(
            '/oauth-boot/oauth/mpLogin',
            { ...data },
            {
                custom: {
                    toast: false,
                },
            }
        ),
    //微信一键获取手机号登录
    getPhoneByWechat: (data: any) => http.post('/oauth-boot/oauth/mpBinding', { ...data }),
    //获取图形验证码
    getImageVerifyCode: (data: any) => http.post('/message-boot/message/sms/getImageVerifyCode', { ...data }),
    //获取滑块验证图片
    getSlideVerify: (data: any) => http.post('/message-boot/message/sms/getSlideVerify', { ...data }),
    //验证滑块
    checkSlideVerify: (data: any) =>
        http.post(
            '/message-boot/message/sms/checkSlideVerify',
            { ...data },
            {
                custom: {
                    catch: true,
                },
            }
        ),
    login: (data: any) =>
        http.post(
            '/oauth-boot/oauth/login',
            { ...data },
            {
                custom: {
                    catch: true,
                    showLoading: true,
                    loadingText: '登录中...',
                    loadingMask: true,
                },
            }
        ),
    //发送验证码
    sendVerifyCode: (data: any) =>
        http.post(
            '/message-boot/message/sms/sendVerifyCode',
            { ...data },
            {
                custom: {
                    catch: true,
                    showLoading: true,
                    loadingMask: true,
                },
            }
        ),
    // 初步验证短信验证码
    checkVerifyCode: (data: any) => http.post('/message-boot/message/sms/preliminarySubmitVerifyCode', { ...data }),
    findPwd: (data: any) =>
        http.post(
            '/oauth-boot/oauth/findPwd',
            { ...data },
            {
                custom: {
                    showLoading: true,
                    loadingMask: true,
                },
            }
        ),
    register: (data: any) => http.post('/oauth-boot/oauth/register', { ...data }),
    logout: (data: any) =>
        http.post(
            '/oauth-boot/oauth/logout',
            {},
            {
                custom: {
                    catch: true,
                },
            }
        ),
};
